home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * notetest -
- * test the note code
- *
- * Paul Haeberli - 1991
- */
- #include "math.h"
- #include "stdio.h"
- #include "gl.h"
- #include "device.h"
- #include "sample.h"
-
- sample *s0, *s1, *s2;
- float frand();
-
- #define SWINGA 0.0
- #define SWINGB 0.66666
-
- #define ECHOQUANT 0.75
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- int i, j, doecho;
- sample *s;
-
- s0 = readsample("a.a");
- s1 = readsample("b.a");
- s2 = readsample("c.a");
-
- if(argc>2)
- sethumanize(atof(argv[1]),atof(argv[2]));
- else
- sethumanize(0.005,0.3);
- scalesample(s2,0.5);
- beginnotes();
- setbpm(110.0);
- for(i=0; i<200; i++) {
- flushnotes(i-4.0);
- if(i<8 || i&1)
- s = s0;
- else
- s = s1;
- playnote(s,i+0.0,0.5);
- if((random()%8)<4) {
- playnote(s,i+1*ECHOQUANT,0.50);
- playnote(s,i+2*ECHOQUANT,0.25);
- }
- if((i%8) == 0)
- j = random()%6;
- if(i<16)
- j = 10;
- switch(j) {
- case 0:
- playnote(s2,i+0.25,1.0);
- playnote(s2,i+0.75,1.0);
- break;
- case 1:
- playnote(s2,i+0.0,1.0);
- playnote(s2,i+0.50,1.0);
- break;
- case 2:
- playnote(s2,i+0.0,1.0);
- playnote(s2,i+0.3333,1.0);
- break;
- case 3:
- playnote(s2,i+0.25,1.0);
- playnote(s2,i+0.75,1.0);
- playnote(s2,i+0.0,1.0);
- playnote(s2,i+0.50,1.0);
- break;
- case 4:
- playnote(s2,i+0.25,1.0);
- playnote(s2,i+0.50,1.0);
- playnote(s2,i+0.75,1.0);
- break;
- case 5:
- playnote(s2,i+0.0,1.0);
- playnote(s2,i+0.66666,1.0);
- break;
- }
-
- }
- endnotes();
- }
-